<%@ page language="java"  pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-2.1.0.js"></script>

<script>
	$(function () {
		$.post("${pageContext.request.contextPath}/news?param=showtwo", function (data) {
			var one =data.one;/*一级目录*/
			var $dl = $(".p_category dl");
			for (var i = 0; i < one.length; i++) {
				var $dt = $("<dt><a href=''>" + one[i].name + "</a></dt>");
				$dl.append($dt);
				var ones =one[i].id;
				for (var j = 0; j < data[ones].length; j++) {//二级目录循环
					var $dd = $("<dd class='pr'><a href='${pageContext.request.contextPath}/product?param=item&id="+data[ones][j].id+"'>"+data[ones][j].name+"</a></dd>");
					if(one[i].name!=data[ones][j].name) {
						$dl.append($dd);
					}
				}
			}
		}, "json")
	})
</script>

<div class="p_category">
	<h2>商品分类</h2>
		<dl>
		<%--<c:forEach items="${product}" var="pro">
			<dt>
				<a href="${pageContext.request.contextPath}/news?param=showtwo&id=${pro.id}" id="one">${pro.name}</a><br>

			</dt>
		</c:forEach>
			<c:forEach items="${prolist2}" var="pro2" begin="1">
				<dd>
					<a href="">${pro2.name}</a>
				</dd>
			</c:forEach>--%>
		</dl>
</div>

